<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserAddressTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //用户收货地址
        Schema::create('delivery_address',function(Blueprint $table){
            $table->increments('id');
            $table->integer('uid')->comment('用户ID');
            $table->string('delivery_user',30)->comment('收货人');
            $table->string('phone',15)->comment('收货人电话');
            $table->string('address',600)->comment('收货地址');
            $table->string('detailed',600)->comment('街道地址');
            $table->enum('default',['0','1'])->default('0')->comment('是否为默认地址，默认值为0，不是默认收货地址');
            $table->timestamps();
            $table->softDeletes();
            $table->index('uid');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
